package main.scala.chapter02
import collection.mutable
object Test38_Queue {
  def main(args: Array[String]): Unit = {
    //队列 先进先出
    val queue = mutable.Queue[String]()
    //入队
    queue.enqueue("a")
    queue.enqueue("b")
    queue.enqueue("c")
    println(queue)
    //出队和入队顺序一致
    println(queue.dequeue())
    println(queue.dequeue())
    println(queue.dequeue())
    //多线程
    val result1 = (0 to 100).map{
      case _ => Thread.currentThread.getName
    }
    val result2 = (0 to 100).par.map{
      case _ => Thread.currentThread.getName
    }
    println(result1)
    println(result2)
  }
}
